<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="js/jquery-3.5.1/jquery-3.5.1.min.js"></script>
<script>
    $(function () {
        //点击提交
        $("#submitBtn").click(function (){
            let formData={
                username: $("#username").val(),
                password: $("#password").val()
            }
           $.ajax({
               type:"POST",
               url: "http://localhost:8080/User/login",
               data: formData,
               success(res){
                   console.log(res);
               },
               error(res){
                   console.log("登录失败")
               }
           })
        })
    })
</script>
<body>
<form >
    用户名:<input type="text" id="username"><br>
    密码:<input type="password" id="password"><br>
    <input type="button" id="submitBtn" value="登录"><br>
</form>
</body>
</html>